package org.lemon.transport.coap.adapter;

import com.google.protobuf.Descriptors;
import org.eclipse.californium.core.coap.Request;
import org.eclipse.californium.core.coap.Response;
import org.lemon.transport.context.adaptor.AdaptorException;
import org.server.transport.gen.TransportProto;

import java.util.UUID;

public interface CoapTransportAdaptor {

    TransportProto.PostTelemetryMsg convertToPostTelemetry(UUID sessionId, Request inbound, Descriptors.Descriptor telemetryMsgDescriptor) throws AdaptorException;

    TransportProto.PostAttributeMsg convertToPostAttributes(UUID sessionId, Request inbound, Descriptors.Descriptor attributesMsgDescriptor) throws AdaptorException;

    TransportProto.GetAttributeRequestMsg convertToGetAttributes(UUID sessionId, Request inbound) throws AdaptorException;

    Response convertToPublish(TransportProto.AttributeUpdateNotificationMsg msg) throws AdaptorException;

    Response convertToPublish(TransportProto.GetAttributeResponseMsg msg) throws AdaptorException;

    int getContentFormat();
}
